<?php
/*
 * Creative Bulletin Board Generation 3
 * Version 1.0 Beta 1
 +------------------------------------
 * User Application, Logout Module (Frontend)
 * Started: 6 September 2009 20:17 PM (Last one for the day, and I'm commiting)
 * Script version: 1.0
 +------------------------------------
 */

class module implements module_interface{
	public function returninitvars(){
		global $lang;
		$this->info["page_title"] = $lang->getByKey("user.logout");
		$this->info["page_description"] = "";
		$this->info["module_version"] = "1.0";
		return $this->info;
	}

	public function construct(){}
	
	public function run(){
		global $view, $config, $db, $main, $lang;
		if(isset($_SESSION['cf_username'])){
			unset($_SESSION['cf_username']);
		}
		if(isset($_SESSION["cf_admin_username"])){
			// Gotta log it out too... security fix
			unset($_SESSION['cf_admin_username']);
		}
		if(isset($_SESSION['cf_controller'])){
			unset($_SESSION['cf_controller']);
		}
		$view->writeIn($view->inlineSuccess($lang->getByKey("user.logout.success"), "index.php"));
	}

	public function destruct(){}
}
